package com.vehicle.controller;


import com.vehicle.service.RoleUserService;
import com.vehicle.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 校园车辆管理系统
 * @since 2023-05-28
 */
@RestController
@RequestMapping("/role-user")
public class RoleUserController {

    @Autowired
    RoleUserService roleUserService;


    //根据用户id获取角色id
    @GetMapping("/getRoleId1/{userId}")
    public Integer getRoleIdByUser(@PathVariable("userId") Integer userId){
        return roleUserService.getRoleIdByUserId(userId);
    }

    //根据管理员id获取角色id
    @GetMapping("/getRoleId2/{adminId}")
    public Integer getRoleIdByAdmin(@PathVariable("adminId") Integer adminId){
        return roleUserService.getRoleIdByAdminId(adminId);
    }


}

